function OUT_Symbols = HF_Descrambling_PSK (IN_Frame,Rate)

%*------------------------------ HF_Descrambling_PSK --------------------------------------%
%
% HF_Descrambling_PSK
%
% The fuction that de-scrambling the input frame dependent on its rate, and
% hence the length of output frame length must match with the corressponding
% rate as follows:
%
%
%           Rate            |           Input Frame Length
%
%           3200           |                    512
%           4800           |                    768
%
%
%*------------------------------------------------------------------------------------%

global LFSR_out

% LUT_Rate_Symbols = [2 3 4 5 6 6]; %No of symbols corressponding to each rate.
% Data_Rates = [3200 4800 6400 8000 9600 12800];
% Rate_Index = find(Data_Rates==Rate);


% LFSR INITIALIZATION by one
% LFSR_Register = [0 0 0 0 0 0 0 0 1];
% N_Symbols = LUT_Rate_Symbols(Rate_Index); % No of Symbols for the current rate


% for index = 1:256
    

%     LFSR_Int =bi2de(fliplr((LFSR_Register(9-N_Symbols+1:9))));
    %transform the output of the LFSR to integer format
    OUT_Symbols = IN_Frame.*exp(-1i*LFSR_out*pi/4);
      
%     % LFSR OPERATION
%     for lfsr_index = 1:N_Symbols  %shifting by the number of symbols
%         LFSR_Calc_Value = bitxor (LFSR_Register(9),LFSR_Register(5)) ;
%         %Actually we are xoring the LFSR_Register(1) and LFSR_Register(5)
%         %and the out in LFSR_Register(9), but the equation reversed for the
%         %reason of LFSR_Register vector arrangement.
%         LFSR_Register(2:9) = LFSR_Register (1:8);
%         %shift one bit
%         LFSR_Register(1) = LFSR_Calc_Value;
%     end
    
end




